package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class Test1
{
    public static void main(String[] args) throws  Exception
    {
        Class person = Class.forName("reflect.Person");
        Object p = person.newInstance();
        Method[] methods = person.getMethods();
        for (Method method : methods)
        {
            if (method.isAnnotationPresent(AutoRunMethod.class))
            {
                method.invoke(p);
            }
        }
    }
}
